The Hough transform may be used to detect a line segment contained in an image. A straight line (x cos θ+y sin θ=ρ) that passes through an arbitrary point in an image with an X-Y coordinate system is converted to coordinates (θ,ρ) in the Hough space. The number of straight lines that can be converted to a particular set of coordinates (θ,ρ) in the Hough space are counted using a two-dimensional array [θ][ρ]. Based on the value sets of coordinates (θ,ρ) with a count larger than a predetermined threshold in the two-dimensional array [θ][ρ], a straight line in the X-Y coordinate system is detected.
An arc ((x−a)2+(y−b)2=r2) that passes through an arbitrary point in an image with an X-Y coordinate system is converted to coordinates (a,b,r) in the Hough space. The number of arcs that can be converted to a particular set of coordinates (a,b,r) in the Hough space are counted using a three-dimensional array [a][b][r]. Based on the value sets of coordinates (a,b,r) with a count larger than a predetermined threshold in the three-dimensional array [a][b][r], an arc in the X-Y coordinate system is detected.
In Patent Document 1, specified below, an image is divided into subareas to detect a line segment in the image by using the Hough transform. In Patent Document 2, also specified below, an attempt is made to optimize the sampling interval for the parameters θ and ρ in the Hough space depending on the length of a straight line. In Patent Document 3, specified below, the Hough transform is also used to detect a line segment contained in an image.